{	Problem: http://codeforces.ru/problemset/problem/19/A
	Verdict: Accepted
}
uses sysutils;
type team=record
  n:string;
  g,b,p,r:longint;
end;
var i,n,k,g1,g2,l,r,j:longint; h:array[1..30] of string; t:array[1..60] of team; a:array[1..60] of longint; s,n1,n2:string;
procedure qsort_p(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=t[a[(l+r) div 2]].p;
repeat
  while t[a[i]].p>x do inc(i);
  while t[a[j]].p<x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort_p(l,j);
if i<r then qsort_p(i,r);
end;
procedure qsort_2(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=t[a[(l+r) div 2]].r;
repeat
  while t[a[i]].r>x do inc(i);
  while t[a[j]].r<x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort_2(l,j);
if i<r then qsort_2(i,r);
end;
procedure qsort_3(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=t[a[(l+r) div 2]].g;
repeat
  while t[a[i]].g>x do inc(i);
  while t[a[j]].g<x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort_3(l,j);
if i<r then qsort_3(i,r);
end;
procedure qsort_4(l,r:longint);
var i,j:longint; x,y:string;
begin
i:=l;
j:=r;
x:=h[(l+r) div 2];
repeat
  while h[i]<x do inc(i);
  while h[j]>x do dec(j);
  if i<=j then begin
    y:=h[i];
    h[i]:=h[j];
    h[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort_4(l,j);
if i<r then qsort_4(i,r);
end;
begin
readln(n);
for i:=1 to n do begin
  readln(t[i].n);
  t[i].g:=0;
  t[i].b:=0;
  t[i].p:=0;
  a[i]:=i;
end;
k:=(n*(n-1)) div 2;
for i:=1 to k do begin
  readln(s);
  n1:=copy(s,1,pos('-',s)-1);
  delete(s,1,pos('-',s));
  n2:=copy(s,1,pos(' ',s)-1);
  delete(s,1,pos(' ',s));
  g1:=strtoint(copy(s,1,pos(':',s)-1));
  delete(s,1,pos(':',s));
  g2:=strtoint(s);
  j:=0;
  while j<n do begin
    inc(j);
    if t[j].n=n1 then begin
      inc(t[j].g,g1);
      inc(t[j].b,g2);
      if g1>g2 then inc(t[j].p,3) else
      if g1=g2 then inc(t[j].p,1);
    end;
    if t[j].n=n2 then begin
      inc(t[j].g,g2);
      inc(t[j].b,g1);
      if g1<g2 then inc(t[j].p,3) else
      if g1=g2 then inc(t[j].p,1);
    end;
  end;
end;
for i:=1 to n do t[i].r:=t[i].g-t[i].b;
qsort_p(1,n);
l:=1;
r:=1;
for i:=2 to n do begin
  if t[a[i]].p=t[a[i-1]].p then inc(r) else begin
    if l<>r then qsort_2(l,r);
    l:=i;
    r:=i;
  end;
end;
l:=1;
r:=1;
for i:=2 to n do begin
  if t[a[i]].r=t[a[i-1]].r then inc(r) else begin
    if l<>r then qsort_3(l,r);
    l:=i;
    r:=i;
  end;
end;
n:=n div 2;
for i:=1 to n do h[i]:=t[a[i]].n;
qsort_4(1,n);
for i:=1 to n do writeln(h[i]);
end.